package de.androidDevelopers.communityTeacherApp.Tests;

import junit.framework.TestCase;

import de.androidDevelopers.communityTeacherApp.models.*;

/**
 * Created by feltmann on 12.04.13 at 18:21
 * Copyright (c) 2013 tag new media GmbH & Co. KG. All rights reserved.
 */

// Caution! Unit tests for the objects only, not testing the storage of them or kinda!
public class AllTheTests extends TestCase
{
	Classbook classbook;
    ClassInfo classInfo;
    PupilInfo pupil;
    ContactInfo contactInfo;
    Grade grade;
    HomeworkInfo homeworkInfo;
    RoomInfo roomInfo;
    SubjectInfo subjectInfo;
    

    @Override
    public void setUp()
    {
    	classbook = new Classbook();
        classInfo = new ClassInfo();
        pupil = new PupilInfo();
        contactInfo = new ContactInfo();
        grade = new Grade();
        homeworkInfo = new HomeworkInfo();
        roomInfo = new RoomInfo();
        subjectInfo = new SubjectInfo();
    }
    
    public void testClassbook()
    {
        assertNotNull("Creating a new classbook info didn't work.",classbook);
        assertNull("Classbook #1",classbook.getClassFK());
        //assertNull("Classbook #2",classbook.getClassInfo());
        assertNull("Classbook #3",classbook.getContent());
        assertNull("Classbook #4",classbook.getDate());
        //assertNull("Classbook #5",classbook.getHomeworkInfo());
        assertNull("Classbook #6",classbook.getHomeworkInfoFK());
        assertNull("Classbook #7",classbook.getLesson());
        //assertNull("Classbook #8",classbook.getRoomInfo());
        assertNull("Classbook #9",classbook.getRoomInfoFK());
        //assertNull("Classbook #10",classbook.getSubjectInfo());
        assertNull("Classbook #11",classbook.getSubjectInfoFK());
        assertNull("Classbook #12",classbook.getTopic());
    }

    public void testClassInfo()
    {
        assertNotNull("Creating a new classInfo info didn't work.",classInfo);
        assertNull("Classinfo #1",classInfo.getName());
        assertNull("Classinfo #2",classInfo.getTeacher());
    }

    public void testPupil()
    {
        assertNotNull("Creating a new pupil didn't work", pupil);
        // Uncomment this to get the test failing...
        assertNull("Pupil #1", pupil.getForname());
        assertNull("Pupil #2", pupil.getSurname());
        assertNull("Pupil #3", pupil.getBirthday());
        assertNull("Pupil #4", pupil.getClassFK());
        //assertNull("Pupil #5", pupil.getClassInfo());
        assertNull("Pupil #6", pupil.getContactInfoFK());
        //assertNull("Pupil #7", pupil.getContactInfoList());
        //assertNull("Pupil #8", pupil.getName());
        assertNull("Pupil #9", pupil.getPictureID());
        assertNull("Pupil #10", pupil.getReference_Number());
    }

    public void testContactInfo()
    {
        assertNotNull("Creating a new contactInfo didn't work", contactInfo);
        // Uncomment this to get the test failing...
        assertNull("ContactInfo #1", contactInfo.getAdress());
        assertNull("ContactInfo #2", contactInfo.getName());
        assertNull("ContactInfo #3", contactInfo.getPhone());
        assertNull("ContactInfo #4", contactInfo.getRelation());
    }
    
    public void testGrade()
    {
        assertNotNull("Creating a new Grade didn't work", grade);
        // Uncomment this to get the test failing...
        assertNull("Grade #1", grade.getClassFK());
        //assertNull("Grade #2", grade.getClassInfo());
        assertNull("Grade #3", grade.getDate());
        assertNull("Grade #4", grade.getGrade());
        //assertNull("Grade #5", grade.getPupilInfo());
        assertNull("Grade #6", grade.getPupilInfoFK());
        //assertNull("Grade #7", grade.getSubjectInfo());
        assertNull("Grade #8", grade.getSubjectInfoFK());
        assertNull("Grade #9", grade.getTyp());
    }

    public void testHomeworkInfo()
    {
        assertNotNull("Creating a new HomeworkInfo didn't work", homeworkInfo);
        // Uncomment this to get the test failing...
        assertNull("HomeworkInfo #1", homeworkInfo.getGet());
        assertNull("HomeworkInfo #2", homeworkInfo.getTask());
        assertNull("HomeworkInfo #3", homeworkInfo.getTill());
    }
    
    public void testRoomInfo()
    {
        assertNotNull("Creating a new RoomInfo didn't work", roomInfo);
        // Uncomment this to get the test failing...
        assertNull("RoomInfo #1", roomInfo.getClassFK());
        //assertNull("RoomInfo #2", roomInfo.getClassInfo());
        assertNull("RoomInfo #3", roomInfo.getEquipment());
        assertNull("RoomInfo #4", roomInfo.getRoom_Number());
    }
    
    public void testSubjectInfo()
    {
        assertNotNull("Creating a new SubjectInfo didn't work", subjectInfo);
        // Uncomment this to get the test failing...
        assertNull("SubjectInfo #", subjectInfo.getClassFK());
        //assertNull("SubjectInfo #", subjectInfo.getClassInfo());
        assertNull("SubjectInfo #", subjectInfo.getName());
        assertNull("SubjectInfo #", subjectInfo.getPupilInfoFK());
        //assertNull("SubjectInfo #", subjectInfo.getPupilInfoList());
        assertNull("SubjectInfo #", subjectInfo.getTyp());
    }
    
    @Override
    public void tearDown()
    {
    	classbook = null;
        classInfo = null;
        pupil = null;
        contactInfo = null;
        grade = null;
        homeworkInfo = null;
        roomInfo = null;
        subjectInfo = null;
    }
}
